OpenBuildings GenerativeComponents Help

Color

The GCScript color type represents any of 16,777,216 different colors.

There are several ways to specify a color:

  • If you want to feed the same color value into multiple input ports, you can place a Color node in the graph (from the Node Types dialog, Utility panel) and use the color picker by clicking the output port and picking a desired color graphically.
  • You can enter a color value directly in script code, using the expression in the form of "color(r=n,g=n,b=nh)" in various interfaces. Each number (n) is an integer in the range 0 through 255, representing the intensity of the red, green, or blue component.
  • You can enter a color value directly in script code, using of the predefined colors. The form is "Colors.ColorName". When you are working in an expression field and you enter the text "Colors.", after the period, you see a drop-down list of all the potential color names you can pick.
Note: If you have an older OpenBuildingsā„¢ GenerativeComponents model that works with the MicroStation color indexes, they are still supported. If you specify a single integer as the value of any port that expects a color-type value, OpenBuildingsā„¢ GenerativeComponents will treat that integer as a MicroStation color index and internally translate it into its equivalent color-type representation.